#include <stdio.h>

unsigned short ConvertRGB888ToRGB565(unsigned  char Color[3])
{
	unsigned short Temp; // 2 Byte

	Color[0] = Color[0] >> 3;
	Color[1] = Color[1] >> 2;
	Color[2] = Color[2] >> 3;

	Temp =  (Color[0] << 11) | (Color[1] << 5 ) | Color[2];
	return Temp;
}

void main( )
{      
		unsigned char Color[3] = {255,80,35}; // Color[0] = Red, Color[1] = Green, Color[2] = Blue
		unsigned short RGB = ConvertRGB888ToRGB565(Color);

		printf ("\n After color conversion 0x%x", RGB);
}